package com.jdym.back.controller;


import com.jdym.R;
import com.jdym.back.entity.Role;
import com.jdym.back.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-10-20
 */
@RestController
@CrossOrigin
@RequestMapping("/back/role")
public class RoleController {

    @Autowired
    RoleService roleService;
    @RequestMapping(value = "/findAllRoles")
    public R findAllRoles(){
        List<Role> roles=roleService.getBaseMapper().selectList(null);
        return R.ok().data("roles",roles);
    }
}

